home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / comm / net / monalisa10b.lha / Monalisa / Contributions / NNTPGet / FetchSinceLast.rexx next >
OS/2 REXX Batch file  |  1994-07-26  |  632b  |  23 lines

  1. /* fetch articles since last call */
  2.  
  3. /* move the timestamp 10 minutes into the past to remove any clock difference
  4.    between the Amiga and the NNTP-Server */
  5. now   = time('s') - 600
  6. now   = trunc(now/3600)//60 || ":" || trunc(now/60)//60 || ":" || now//60
  7.  
  8. /* read the last timestamp */
  9. if (open('f','stampfile','r')) then do
  10.     last = readln('f')
  11.     close('f')
  12.     end
  13. else
  14.     last = 'yesterday'
  15.  
  16. /* and put the new timestamp */
  17. open('f','stampfile','w')
  18. writeln('f',now)
  19. close('f')
  20.  
  21. /* run nntpget to fetch something since last invocation */
  22. address command "nntpget FROM comp.sys.amiga.* NNTPSERVER news TO T:newsbatch.nntp since" last
  23.